﻿using UnityEngine;

public class Node
{
    public bool _Canwalk;
    public Vector3 _worldPos;
    public int gridX, gridY;
    /// <summary>
    /// 与起始点的距离
    /// </summary>
    public int gCost;
    /// <summary>
    /// 与目标的的距离
    /// </summary>
    public int hCost;

    /// <summary>
    /// G和H的和，选择路径中经过哪个方格的关键是F花费值
    /// </summary>
    public int fCost
    {
        get { return gCost + hCost; }
    }

    public Node parent;

    public Node(bool canwalk, Vector3 postion, int x, int y)
    {
        _Canwalk = canwalk;
        _worldPos = postion;
        gridX = x;
        gridY = y;
    }

}
